import java.io.*;
import java.util.*;

public classTaskD extends Thread {
    public TaskD() {
        try {
            this.input = new BufferedReader(new FileReader("input.txt"));
            this.output = new PrintWriter("output.txt");
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Exception e) {
            System.exit(666);
        }
    }

    static final int decide(int n, int k) {
        return (n >> 1 == k && k << 1 == n) ? 1 : 2;
    }


    private void solve() throws Throwable {
        int testCount = nextInt();
        for (int test = 0; test < testCount; ++test) {
            int n = nextInt();
            double p = nextDouble(), q = nextDouble(), r = nextDouble();
            int rounds = nextInt();
            ans = new double[rounds];
            for (int cnt = 1; (cnt << 1) <= n; ++cnt) {
                for (double[] current : dp) {
                    Arrays.fill(current, 0);
                }
                dp[0][cnt] = 1;
                for (int played = 0; played < rounds; ++played) {
                    for (int remaining = 1; remaining + 1 <= n; ++remaining) {
                        dp[played + 1][remaining] += dp[played][remaining] * r;
                        dp[played + 1][remaining + 1] += dp[played][remaining] * p;
                        dp[played + 1][remaining - 1] += dp[played][remaining] * q;
                    }
                    ans[played] += decide(n, cnt) * dp[played + 1][cnt];
                }
            }
            for (double current : ans) {
                output.println(current / (n - 1));
            }
        }

    }


    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskD().start();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }

    static double[][] dp = new double[1601][27];
    static double[] ans;

    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}